<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Listado de Roles</title>
        <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen">        
    </head>
    <body>
        <f:view >
            <%@ include file="/barra.jsp" %>
            <table width="1242" border="0">
                <tr>
                    <td width="21%" align="left" valign="top">
                        <!-- Divisor del Contenido Principal -->
                        <div id="siteName">                        </div>
                        <div id="content"> 
                            <div class="feature">
                                <jsp:directive.include file="/welcomeJSF.jsp" />
                            </div> 
                        </div> 
                        
                    <!-- Fin del Contenido Principal -->                  </td>
                    <td width="79%" align="left" valign="top">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        <h1>Listado de Roles</h1>
                        <h:form>
                            <h:outputText escape="false" value="(sin registros)<br />" rendered="#{rol.itemCount == 0}" />
                            <h:panelGroup rendered="#{rol.itemCount > 0}">
                                <h:dataTable value='#{rol.rols}' var='item' styleClass="names" headerClass="namesHeader" columnClasses="last,first">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Id Rol"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.idRol}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Descripción Rol"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.descripcionRol}"/>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                            <br />
                            <h:commandLink styleClass="boton" action="#{rol.createSetup}" value="[Nuevo]"/>
                            <br />
                            
                        </h:form>
                    </td>
                </tr>    
            </table>
            
            <%@ include file="/footer.jsp" %>            
        </f:view>
    </body>
</html>
